<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions 
 * @package    Sociealengineaddon
 * @copyright  Copyright 2009-2011 BigStep Technologies Pvt. Ltd.
 * @license    http://www.socialengineaddons.com/license/
 * @version    $Id: index.tpl 2011-02-16 9:40:21Z SocialEngineAddOns $
 * @author     SocialEngineAddOns
 */
?>
<h3>
  <?php echo $this->translate('Latest versions of SocialEngineAddOns plugins for your site') ?>
</h3>
<p>
	<?php echo $this->translate('The latest versions of these plugins are available to you in your SocialEngineAddOns Client Area. Login into your SocialEngineAddOns Client Area here: http://www.socialengineaddons.com/user/login .'); ?>
</p><br/>

<div class='sociealengineaddons_admin_tabs'>
  <?php
    // Render the menu
    echo $this->navigation()->menu()->setContainer($this->navigation)->render()
  ?>
</div>

<?php
	if( count($this->channel) ):
		$isPlugin = false;
?>
  <table class='admin_table'>
    <thead>
      <tr>

         <th align="left">
        	<?php echo $this->translate("Plugin Title"); ?>
        </th>
        <th align="left">
        	<?php echo $this->translate("Latest version on SocialEngineAddOns.com"); ?>
        </th>
        <th align="left">
        	<?php echo $this->translate("Version on your website"); ?>
        </th>
        <th align="left">
        	<?php echo $this->translate("Should you Upgrade?"); ?>
        </th>
      </tr>
    </thead>
    <tbody>
    	<?php foreach ($this->channel as $item):?>	
			<?php
				$running_version = $item['running_version'];
				$product_version = $item['product_version'];
				$versionInfo = 0;
				$status = $this->translate('No');
				if( !empty($running_version) && !empty($product_version) ) {
					$isPlugin = true;
					$versionInfo = strcasecmp($product_version, $running_version);
					if( $versionInfo > 0 ) {
						$status = $this->translate('Yes');
					}
				?>
        <tr>
          <td><?php echo $item['title']; ?></td>
					<td><?php echo $product_version; ?></td>
					<td><?php echo $running_version; ?></td>
					<td><?php echo $status; ?></td>
        </tr>
			<?php } ?>
      <?php endforeach; ?>
    </tbody>
  </table>
  <br />

<?php endif; 
		if( empty($isPlugin) ):?>
      <?php echo '<div class="tip"><span>No plugins by SocialEngineAddOns were found on your site. Click <a href="http://www.socialengineaddons.com/catalog/1/plugins" target="_blank">here</a> to view and purchase them.</span></div>'; ?>
<?php endif; ?>